clear 
cd "C:\Users\selfd\Documents\autopartyinstitutionalization\legacy\cps\replication\data\stata"
use "C:\Users\selfd\Documents\autopartyinstitutionalization\legacy\cps\replication\data\stata\stata_replication.dta"

xtset ccode year

xtpcse v2xps_party i.gwf_prior c.reactive##c.prior_pi pi1 v2x_polyarchy lgdp fsu ussr_sat av_dm, pairwise


* Run the margins command
 margins, dydx (reactive) at (prior_pi=(0(0.01)1)) saving("margins4.1.dta", replace)
 
 
clear 
use "C:\Users\selfd\Documents\autopartyinstitutionalization\legacy\cps\replication\data\stata\stata_replication.dta"

xtset ccode year

xtpcse v2xps_party i.gwf_prior c.reactive##c.prior_pi pi1 v2x_polyarchy lgdp fsu ussr_sat av_dm, pairwise


* Run the margins command
 margins, dydx(prior_pi) at(reactive=(0 1)) saving("margins4.2.dta", replace)
 
 
